{extend name="public/common"} {block name="body"}

<style type="text/css">
	.bg-1 {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}
 .radius:hover{
 	background:#e5e5e5;
 	border-color: #e5e5e5;
 	color: #333;
 }
 span:hover{
 	color: #333;
 }
</style>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    系统管理
    <span class="c-gray en">&gt;</span>
    财务设置
    <span class="c-gray en">&gt;</span>
    提现银行设置
    <a class="btn btn-success radius r"
       style="line-height: 1.6em; margin-top: 3px"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>


<div style="padding:20px;height:30px;">
  	
  	<div class="new_box">
<div style="height:30px;margin-bottom: 24px;">
    <div style="float:left;height: 40px;width: 100%;background-color: #e5e5e5 !important;border-bottom: 1px solid #e4e7ed;">
        <a style="background: #636363;border-color: #636363;color: #fff;" class="btn btn-primary radius"  href="javascript:bank_detail('新增银行','{:url(\'Paysetting/addBank\')}');">新增银行</a>
    </div>
</div>
<div class="page-container dataTables_wrapper" style="padding-top:0;">
    <div id="tab-system" class="HuiTab">
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
                <thead>
                <tr class="text-c">
                    <th>ID</th>
                    <th>银行名称</th>
                    <th>操作</th>
                </tr>
                {volist name="list" id="v"}
                </thead>
                <tbody>
                <tr class="text-c" id="tr_{$v.id}">
                    <td>{$v.id}</td>
                    <td>{$v.bankname}</td>
                    <td>
                        <a href="javascript:bank_detail('编辑银行','{:url(\'Paysetting/addBank\')}?id={$v.id}');">编辑</a> |
                        <a href="javascript:delBank({$v.id})">删除</a>
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
        </div>
    </div>
    <div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
        <span style="float:right;margin-left:-2px;">总共{$list->lastPage()}页  当前第{$list->currentPage()}页 ，共{$list->total()}条</span>
        <div style="float:left;">{$list->render()}</div>
    </div>
</div>
</div>
</div>

{/block}
{block name="js"}
<script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript">
    function bank_detail(title,url){
        layer.open({
            type: 2,
            title: title,
            area: ['40%', '40%'],
            content: url
        });
    }
    function delBank(id){
        if(confirm('是否确认操作？')){
            $.ajax({
                type : "post",
                url : "{:url('paysetting/delBank')}",
                data : {"id":id},
                success: function (data) {
                    console.log(data);
                    data = parseInt(data);
                    if( 1==data ){
                        $('#tr_'+id).remove();
                        layer.msg('删除成功', {icon: 1});
                    }else if( 2==data ){
                        layer.msg('银行正在被使用', {icon: 5});
                    }else{
                        layer.msg('删除失败', {icon: 5});
                    }
                }
            });
        }
    }
</script>

{/block}




